<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/


//Routes root (/) to dashboard(dashboard routes to login if your not logged in)
Route::resource('/','DashboardController');


Route::get('login', array('uses' => 'HomeController@showLogin'));

// route to process the form
Route::post('login', array('uses' => 'HomeController@doLogin'));

Route::get('logout', array('uses' => 'HomeController@doLogout'));

//Routes to the /customers to the CustomerController
Route::get('customers/datatable','CustomerController@Datatable');
Route::resource('customers','CustomerController');

//Purchase Orders
Route::get('purchaseorders/datatable','PurchaseorderController@Datatable');
Route::resource('purchaseorders','PurchaseorderController');

//Vendors
Route::get('vendors/datatable','VendorController@Datatable');
Route::resource('vendors','VendorController');
